<!--
 * @Description: 公司质量参数
 * @Autor: wangwangwang
 * @Date: 2021-03-15 09:36:02
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-12-30 11:02:53
-->
<template>
  <div class="pages_content table">
    <el-container>
      <el-header>
        <breaDcrumb />
      </el-header>
      <el-main>
        <div class="tabtop">
          <div v-for="(item, index) in contractTypelist" :key="index" @click="choose(item.id)">
            <div :class="currenindex == index ? 'active' : 'text'">{{ item.value }}</div>
            <div v-if="currenindex !== index && currenindex !== index + 1 && index !== 4" class="hr"></div>
          </div>
        </div>
        <!-- 质量参数 -->
        <div v-if="currenindex == 0">
          <div class="toptop">
            <div>
              <span>
                <span style="margin-right: 24px;">公司</span>
                <el-select ref="select" v-model="companyId" placeholder="请选择" @change="$nextTick(()=>{companyName = $refs.select.selectedLabel; qualityTemplateConfig.companyId = companyId})">
                  <el-option v-for="(item, index) in companylist" :key="index" :label="item.name" :value="item.id"></el-option>
                </el-select>
              </span>
            </div>
          </div>
          <div class="info" style="display: flex;">
            <div class="left">
              <!-- 左侧导航 -->
              <div class="nav">
                <template v-for="(item, index) in leftList">
                  <div :key="index" :style="'width:' + 100 / leftList.length + '%'" :class="item.value == showleftIndex ? 'left-active' : ''" @click="change('leftIndex','showleftIndex',item.value); rIndex = 0">{{ item.text }}</div>
                </template>
              </div>
              <!-- 原物料名称 -->
              <div class="radio leftitem">
                <div style="padding:10px 0;">
                  {{showleftIndex===1?'原物料名称':'强度等级'}}:
                </div> 
                <el-select v-model="showleftitemId" filterable placeholder="请选择" @change="changeRaw">
                  <el-option v-for="(item, index) in leftitemList" :key="index" :label="item.name" :value="item.name"></el-option>
                </el-select>
                <div v-show="showleftIndex==1">
                  <div style="padding:10px 0;">
                    规格:
                  </div> 
                  <el-select v-model="specification" filterable placeholder="请选择" @change="change('leftitemId','specification',specification)">
                    <el-option v-for="item in specificationList" :key="item.specificationId" :label="item.specification" :value="item.specification"></el-option>
                  </el-select>
                </div>
              </div>
            </div>
            <div class="center"></div>
            <div class="right">
                <!-- 原物料 -->
                <div v-show="leftIndex == 1">
                    <div class="nav">
                        <div style="width: 50%" :class="{ 'left-active': rIndex === 0 }" @click="rIndex = 0">原物料检验</div>
                        <div style="width: 50%" :class="{ 'left-active': rIndex === 1 }" @click="rIndex = 1">交工数据标准</div>
                    </div>
                    <QualityTemplate v-show="rIndex === 0" :templateIndex="selectTemplateIndex" templateType="company" :config="qualityTemplateConfig"/>
                    <!-- 交工数据标准 -->
                    <DueDataStandard v-show="rIndex === 1" :index="selectTemplateIndex" :config="qualityTemplateConfig" />
                </div>
                <!-- 混凝土 -->
                <div v-show="leftIndex == 2">
                    <div class="nav">
                        <div style="width: 50%" :class="{ 'left-active': rIndex === 0 }" @click="rIndex = 0">混凝土</div>
                        <div style="width: 50%" :class="{ 'left-active': rIndex === 1 }" @click="rIndex = 1">交工数据标准</div>
                    </div>
                    <BetonConfig v-show="rIndex === 0" :config="qualityTemplateConfig" />
                    <!-- 交工数据标准 -->
                    <DueDataStandard2 v-show="rIndex === 1" :config="qualityTemplateConfig" />
                </div>
            </div>
          </div>
        </div>
        <!-- 参数设置 -->
        <set v-if="currenindex == 1"></set>
        <!--物料绑定检测 -->
        <binding v-if="currenindex == 2"></binding>
        <!--检测频率设置 -->
        <frequency v-if="currenindex == 3"></frequency>
        <LabelLife v-if="currenindex == 4"></LabelLife>
      </el-main>
    </el-container>
  </div>
</template>
<script src="./js/quality.js"></script>
<style lang="scss" src="./css/quality.scss" scoped></style>
